package com.appcheck.recording.listener.impl;

import android.text.Editable;
import android.text.TextWatcher;

import com.appcheck.recording.ListenerManager;
import com.appcheck.recording.action.impl.TextChangedAction;
import com.appcheck.recording.utils.Logger;

public class RecordingTextWatcher implements TextWatcher {

	@Override
	public void beforeTextChanged(CharSequence s, int start, int count,
			int after) {
	}

	@Override
	public void onTextChanged(CharSequence s, int start, int before, int count) {
		
	}

	@Override
	public void afterTextChanged(Editable s) {
		TextChangedAction textChangedAction = new TextChangedAction();
		textChangedAction.setText(s.toString());
		//Logger.DEBUG("create textChangedAction " + textChangedAction.toString());
		ListenerManager.getListenerManager().handleAction(textChangedAction);
	}

}
